<!DOCTYPE html>
<html>
<head>
    <title>GET请求示例</title>
</head>
<body>
    <button onclick="sendGetRequest()">发起GET请求</button>
    <div id="result"></div>

    <script>
        function sendGetRequest() {
            var xhr = new XMLHttpRequest();
            xhr.open("GET", "http://127.0.0.1:9381/hello", true);
            xhr.onreadystatechange = function() {
                console.log(xhr)
                if (xhr.readyState === 4 && xhr.status === 200) {
                    var response = JSON.parse(xhr.responseText);
                    document.getElementById("result").innerHTML = response;
                }
            };
            xhr.send();
        }
    </script>
</body>
</html>